<template>
  <div class="app-container" style="padding: 0px;position:relative;">
    <div style="color: #72A4FF;font-size: 20px;font-weight: bold;">报文统计</div>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-card class="box-card" style="height:80px;background: #1DBBAE;border-radius:10px;margin-top: 40px;color: #FFFFFF;">
          <div style="font-size: 25px;text-align: center;margin-top: 8px;">日到报数：{{queryNum}}</div>
        </el-card>
      </el-col>
      <el-col :span="12">
        <el-card class="box-card" style="height:80px;background: #1DBBAE;border-radius:10px;margin-top: 40px;color: #FFFFFF;">
          <div style="font-size: 25px;text-align: center;margin-top: 8px;">日到报率：{{numRate}}%</div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import { parseTime } from "@/utils/ruoyi";
  import { listDataMsgLog,queryCountDay } from "@/api/basic/dataMsgLog";

  export default {
    components: {},
    data() {
      return {
        queryNum:0,
        numRate:0,
        queryCountParams:{
          beginTime:null,
          endTime:null
        },
      };
    },
    mounted() {
      let nowDate = new Date();
      this.dataTime = parseTime(nowDate,'{y}-{m}-{d}');
      this.queryCountParams.beginTime = parseTime(nowDate,'{y}-{m}-{d}')+' 00:00:00';
      this.queryCountParams.endTime = parseTime(nowDate,'{y}-{m}-{d}')+' 23:59:59';
      this.getCountDay();
    },
    created() {

    },
    methods: {
      getCountDay() {
        let _this = this;
        _this.queryNum = 0;
        _this.dayNum = 0;

        // listDataMsgLog(this.queryCountParams).then(response => {
        //
        // })
        queryCountDay(this.queryCountParams).then(response => {
          _this.queryNum = response.queryNum;
          if(response.queryNum!=0){
            _this.numRate = (response.queryNum/response.dayNum).toFixed(2)*100;
          }
        })
      },

    },
  };
</script>

